package zservice

import (
	"znet/glog"
	"errors"
	"znet/zrpc"
)

type ServiceModule struct {
	Addr string 			// 地址
	*zrpc.RpcServer
}

func (this *ServiceModule)Init() {
	this.RpcServer = &zrpc.RpcServer{}
	this.RpcServer.Init(this.Addr)
}
func (this *ServiceModule)Start() error{
	if this.RpcServer == nil {
		glog.Fatal("Start RPC server Error: ","RpcServer is nil")
		return errors.New("RpcServer is nil")
	}
	return this.RpcServer.Start()
}